[3.x] Fast forward resolved/rejected promises with await#22
Closed
WyriHaximus wants to merge 1 commit intoreactphp:3.xfrom
Closed
[3.x] Fast forward resolved/rejected promises with await#22WyriHaximus wants to merge 1 commit intoreactphp:3.xfrom
WyriHaximus wants to merge 1 commit intoreactphp:3.xfrom
Conversation
b67fea3 to
cd54e6d
Compare
clue
reviewed
Jan 25, 2022
584e5b0 to
aa33246
Compare
67d87b0 to
b9e36aa
Compare
clue
reviewed
Feb 11, 2022
This makes `await`ing an already resolved promise significantly faster. Ported from: reactphp#18
b9e36aa to
4d9d827
Compare
Member
Author
|
After discussing this PR with @SimonFrings and @clue we came to the conclusion that porting #18 to #21 and this PR doesn't introduce only more code and no performance gainst at all. We got a bit excited about the idea of doing this without realizing this makes the function more complex while the loop would instantly be stopped anyway. And that fraction of a millisecond gain we might get from doing this is not worth it. It was however very much worth doing this for fibers in #18. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes
awaiting an already resolved promise significantly faster.Ported from: #18